<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
	KA$H FX 
	<?php echo isset($title) ? ":: $title" : ""?>
	<?php echo isset($section) ? ":: $section" : ""?>
	<?php echo isset($subSection) ? ":: $subSection" : ""?>

</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


		<!--here determinate the active  page!-->
		<?php 
		$segment_id = $this->uri->segment(2);
		switch($segment_id){
			case 'home':  $current_class = array('home' => 'current', 'products' => '', 'history' => '', 'clearing' => '', 'about' => '', 'trading_technology' => '', 'contact' => '', 'create_account' => '', 'account' => '', 'ewallet' => '');
		       $page_css = base_url() . 'public/css/home.css';
		    break;

		    case 'about':  $current_class = array('home' => '', 'products' => '', 'history' => '', 'clearing' => '', 'about' => 'current', 'trading_technology' => '', 'contact' => '', 'create_account' => '', 'account' => '', 'ewallet' => '');
		    	 $page_css = base_url() . 'public/css/about.css';
		    break;

		    case 'contact':  $current_class = array('home' => '', 'products' => '', 'history' => '', 'clearing' => '', 'about' => '', 'trading_technology' => '', 'contact' => 'current', 'create_account' => '', 'account' => '', 'ewallet' => '');
		    	 $page_css = base_url() . 'public/css/contact.css';
		    break;
	
		    case 'create_account':  $current_class = array('home' => '', 'products' => '', 'history' => '', 'clearing' => '', 'about' => '', 'trading_technology' => '', 'contact' => '', 'create_account' => 'current', 'account' => '', 'ewallet' => '');
		    	 $page_css = base_url() . 'public/css/create_account.css';
		    break;
	
		    case 'new_account':  $current_class = array('home' => '', 'products' => '', 'history' => '', 'clearing' => '', 'about' => '', 'trading_technology' => '', 'contact' => '', 'create_account' => 'current', 'account' => '', 'ewallet' => '');
		    $page_css = base_url() . 'public/css/reg_payment.css';
		    break;

		    case 'account':  $current_class = array('home' => '', 'products' => '', 'history' => '', 'clearing' => '', 'about' => '', 'trading_technology' => '', 'contact' => '', 'create_account' => '', 'account' => 'current', 'ewallet' => '');
		    $page_css = base_url() . 'public/css/account.css';
		    break;

		    case 'deposit':  $current_class = array('home' => '', 'products' => '', 'history' => '', 'clearing' => '', 'about' => '', 'trading_technology' => '', 'contact' => '', 'create_account' => '', 'account' => 'current', 'ewallet' => '');
		    $page_css = base_url() . 'public/css/account.css';
		    break;
		    
		    case 'ewallet':  $current_class = array('home' => '', 'products' => '', 'history' => '', 'clearing' => '', 'about' => '', 'trading_technology' => '', 'contact' => '', 'create_account' => '', 'account' => '', 'ewallet' => 'current');
		    $page_css = base_url() . 'public/css/ewallet.css';
		    break;
	
		    default:  {$current_class = array('home' => 'current', 'products' => '', 'history' => '', 'clearing' => '', 'about' => '', 'trading_technology' => '', 'contact' => '', 'contact' => '', 'create_account' => '', 'account' => '', 'ewallet' => '');
		    	    $page_css = base_url() . 'public/css/home.css';
		    }
			
		}


		?>
		
		    <!--CSS -->
            <link rel="Stylesheet" type="text/css" href="<?php echo $page_css; ?>" media='screen' />
            <?php if($logged):?> 
	            <link rel="Stylesheet" type="text/css" href="<?php echo base_url(); ?>public/css/user_common.css" media='screen' />
			<?php endif;?>
            <link rel="Stylesheet" type="text/css" href="<?php echo base_url(); ?>public/css/main.css" media='screen' />
            <link rel="Stylesheet" type="text/css" href="<?php echo base_url(); ?>public/css/submenus.css" media='screen' />
            <link rel="Stylesheet" type="text/css" href="<?php echo base_url(); ?>public/css/common.css" media='screen' />
            <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>public/css/ui-lightness/jquery-ui-1.8.11.custom.css" />
            	
            	
			<!-- JavaScripts -->
			<script type="text/javascript" src="<?php echo base_url()?>public/js/jquery-1.5.1.min.js" /></script>
        	<script type="text/javascript" src="<?php echo base_url()?>public/js/jquery.form.js" /></script>
		    <script type="text/javascript" src="<?php echo base_url()?>public/js/common.js"></script>
		    <?php $segment4 = $this->uri->segment(4);
		    	if($segment4 == "internal-transfer"):?>
		    	<script type="text/javascript" src="<?php echo base_url()?>public/js/internal_transfer_form.js"></script>
		    <?php elseif($segment4 == "exchange"):?>
		    	<script type="text/javascript" src="<?php echo base_url()?>public/js/exchange_form.js"></script>
		    <?php elseif($this->uri->segment(2) == "deposit"):?>
		    	<script type="text/javascript" src="<?php echo base_url()?>public/js/deposit_form.js"></script>
		    <?php else :?>
		    <script type="text/javascript" src="<?php echo base_url()?>public/js/account_form.js"></script>
		    <?php endif;?>
			<script type="text/javascript" src="<?php echo base_url()?>public/js/jquery-ui-1.8.11.custom.min.js" /></script>
			<script type="text/javascript" src="<?php echo base_url()?>public/js/account.js" /></script>
		
	</meta>
</head>
<body>
	<div class="wraper">

		<div id="page-header">
		<?php $base_url = base_url(); echo anchor('home', '<img src="' . $base_url . 'public/images/kashfx-logo.gif" alt="KA$H FX" />', array('title' => '... to Home Page', 'class' => 'top-logo'))?>
			<div class="top-right-panel">
				<div class="login-form">
					<?php
						if(!$logged){ 
							$this->load->view("login_view");
						}
						else{
							$this->load->view("user/user_info_view");
							//$data['html'] = $info_view;
							//$this->load->view('user/info_container', $data);
						}
					?>
				</div>
				<div class="language-bar">
					<a href="#" title="Eng">Eng</a> <a href="#" title="Fr">Fr</a> <a
						href="#" title="Russian">Ru</a> <a href="#" title="Chinese">Ch</a>
				</div>
			</div>
			<br class="clear" />
		</div>


		<div id="top-menu">
			<ul>
				<li><?php echo anchor('user/home', "Home", array('title' => 'Home', 'class' => $current_class['home'] ))?>
				</li>
				<li><?php echo anchor('user/about', "ABOUT US", array('title' => 'ABOUT US', 'class' => $current_class['about'] ))?>
				</li>
				<li><?php echo anchor('user/contact', "CONTACT US", array('title' => 'CONTACT US', 'class' => $current_class['contact']))?>
				</li>
				<li><?php echo anchor('user/new_account', "New Account", array('title' => 'New Account', 'class' => $current_class['create_account']))?>
				</li>
				<li><?php echo anchor('user/account', "My Account", array('title' => 'My Account', 'class' => $current_class['account']))?>
				</li>
				<li><?php echo anchor('user/ewallet', "eWallet", array('title' => 'eWallet', 'class' => $current_class['ewallet'], 'id' => 'ewallet_menu'))?>
				</li>
			</ul>
			<div class="top-menu-edge"></div>
		</div>
		
		<div class="bottombar" id="dvBottombar">
			<ul id="secondary">
			<?php foreach ($submenus as $key => $val):?>
					<li>
						<div class="tab_container">
							<div class="mleft">
							</div>
							<div class="tab_content">
								<div class="mright">
								</div>
								<?php 
								$submenu_id = $this->uri->segment(3);
								$values = explode("/", $val);

								if(count($values) == 2 ){
									if($this->uri->segment(2) == "account"){
										if($this->uri->total_segments() == 2){											
											echo anchor($val, $key, "class='tab_link current'");
										}
										else{
											echo anchor($val, $key, "class='tab_link'");
										}
									}
									else{
										
										if($this->uri->segment(2) == $values[1]){
											echo anchor($val, $key, "class='tab_link current'");
										}
										else{
											echo anchor($val, $key, "class='tab_link'");
										}
									}
								}
								else{
									if($values[2] == $submenu_id){
										echo anchor($val, $key, "class='tab_link current'");
									}
									else{
										echo anchor($val, $key, "class='tab_link'");
									}
								}
								?>
							</div>
						</div>
					</li>
			<?php endforeach;?>	
			</ul>
		</div>
		
		<div id="main-section">
		<table  id="contentContainer" cellpadding="0" cellspacing="0" border="0" width="100%" >
			<tr><td id="leftCol" valign="top" width="235px">		
				<div id="accountInfo">
					<?php
						$data["wallets"] = $wallets;
						$data["balance_ammount"] = $balance;
						$data["cSign"] = $cSign;
						$info_view = $this->load->view("user/wallets_info_view", $data, true);
						$data['html'] = $info_view;
						$this->load->view('user/info_container', $data); 
					?>
					<div id="currencyRates">
					</div>
				</div>
			</td><td id="centerCol" valign="top">
			
			<!-- here comes the main content for each page  !-->
			<?php echo isset($subSection) ? "<h1>$subSection</h1>" : ""?>
			<div id="message"></div>
			<div class='info_container'>
					<?php echo $body?>
			</div>
			
			</td><td id="rightCol" valign="top" width="235px">
				<div id="extraInfo">
					<?php 
						$info_view = $this->load->view("user/operations_info_view", "", true);
						$data['html'] = $info_view;
						$this->load->view('user/info_container', $data);
					?>			
					<div class="social-links">
						<?php $this->load->view('social_links');?>
					</div>
				</div>
			</td></tr>
		</table>

		<div id="page-footer">
			<span>&copy; Copyright KASHFX 2011. All rights reserved.</span>
		</div>
	</div>

</body>
</html>